package com.example.taximeter.controller;

import com.example.taximeter.bean.CarInfo;
import com.example.taximeter.bean.Company;
import com.example.taximeter.service.CarInfoService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 出租车
 */
@RestController
@RequestMapping(value = "/carinfo")
public class CarInfoController {

    private CarInfoService carInfoService;

    @Autowired
    public CarInfoController(CarInfoService carInfoService){
        this.carInfoService = carInfoService;
    }

    @RequestMapping(value = "/all")
    public List<CarInfo> getCarInfo(@RequestBody CarInfo carInfo){
        return carInfoService.findCarInfo(carInfo);

    }

    @RequestMapping(value = "/list",method = RequestMethod.GET)
    public List<CarInfo> findCarList(){
        return carInfoService.findCarList();
    }
}
